package com.hellomeng.bean.relation;

import org.springframework.context.ApplicationContext;
import org.springframework.context.support.ClassPathXmlApplicationContext;

public class RelationTest {
    public static void main(String[] args) {
        ApplicationContext applicationContext = new ClassPathXmlApplicationContext("applicationContext.xml");
        Address address1 = (Address)applicationContext.getBean("address1");
        Address address2 = (Address)applicationContext.getBean("address2");
        Address address3 = (Address)applicationContext.getBean("address3");
        System.out.println(address1);
        System.out.println(address2);
        System.out.println(address3);
    }
    //Address{name='zhangsan', city='nanjing', tel='16666666666'}
    //Address{name='lisi', city='nanjing', tel='18888888888'}
    //Address{name='wangwu', city='nanjing', tel='19999999999'}
}
